﻿using DrawTools;
using System;
using System.Windows.Controls;

namespace LS.DicomViewer
{
    /// <summary>
    /// ViewerConfigView.xaml 的交互逻辑
    /// </summary>
    public partial class ViewerConfigView : UserControl
    {
        public static Action<ViewerConfigView> ShowConfigWindow { get; set; }
        public ViewerConfigView()
        {
            InitializeComponent();
            color_picker.SelectedColorChanged += (a, b) => color_picker_Confirmed(null, null);
        }

        private void color_picker_Confirmed(object sender, HandyControl.Data.FunctionEventArgs<System.Windows.Media.Color> e)
        {
            DrawerConfig.Instance.DefaultBrush = color_picker.SelectedBrush;
            btn_color.IsChecked = false;
        }

        private void color_picker_Canceled(object sender, System.EventArgs e)
        {
            btn_color.IsChecked = false;
        }

        private void Popup_Closed(object sender, System.EventArgs e)
        {
            
        }
    }
}